
#define Print(n) printf("the values of " #n " is %d\n", n);
#include "Net.hpp"
#include <iostream>
using namespace std;
class A
{
private:
    static int _k;
    int _h = 1;

public:
    class B // B默认就是A的友元
    {
    public:
        void foo(const A &a)
        {
            cout << _k << endl;   // OK
            cout << a._h << endl; // OK
        }
        int _b1;
    };

private:
    B b;
};
int A::_k = 1;

int main()
{
    cout << sizeof(A) << endl;

    A::B b;
    A aa;
    b.foo(aa);
    return 0;
    //    std::shared_ptr<Message::RpcRequest> rrc=Message::BuildMessage::build<Message::RpcRequest>();
    //    rrc->SetMethod("Add");
    //    Json::Value va;
    //    va["num1"]=1;
    //    va["num2"]=3;
    //    rrc->SetParams(va);

    //    std::string ss=rrc->Serialize();
    //    std::cout<<ss<<std::endl;

    //    std::shared_ptr<Abstract::BaseMessage> rrc1=Message::BuildMessage::create(Rs_RqType::RPC_Req);
    //    rrc1->UnSerialize(ss);

    //    bool ret=rrc1->Check();
    //    if(ret==false)
    //    {
    //     std::cout<<"参数错误"<<std::endl;
    //    }

    // std::shared_ptr<Message::TopicRequest> rrc = Message::BuildMessage::build<Message::TopicRequest>();

    // rrc->SetTopOper(TopicOperType::Topic_SendMesg);
    // rrc->SetTopic("music");
    // rrc->SetTopicMsg("sfsdfsdf");
    // std::string ss = rrc->Serialize();

    // std::cout << ss << std::endl;
    // bool ret = rrc->Check();

    //  ss = rrc->Serialize();
    // std::cout << ss << std::endl;
    // ret = rrc->Check();
    // std::cout << ss << std::endl;

    // std::shared_ptr<Message::ServerRequest> rrc = Message::BuildMessage::build<Message::ServerRequest>();

    // rrc->SetMethod("add");
    // rrc->SetSerOper(ServiceOptype::SERVICE_Online);
    // rrc->SetHost({"111.111.11",8080});
    // std::string ss = rrc->Serialize();

    // std::cout << ss << std::endl;
    // bool ret = rrc->Check();

    //  ss = rrc->Serialize();
    // std::cout << ss << std::endl;
    // ret = rrc->Check();
    // std::cout << ss << std::endl;

    // std::shared_ptr<Message::RpcReponceJson> rrc = Message::BuildMessage::build<Message::RpcReponceJson>();
    // rrc->Setcode(ResCode::ResCode_Ok);
    // rrc->SetResult(4);
    // bool ret = rrc->Check();
    // std::string ss=rrc->Serialize();
    // std::cout << ss << std::endl;

    // std::shared_ptr<Message::ServerReponceJson> rrc = Message::BuildMessage::build<Message::ServerReponceJson>();
    // rrc->Setcode(ResCode::ResCode_Ok);
    // rrc->SetSerOper(ServiceOptype::SERVICE_Discover);
    // rrc->SetMethod("add");
    // std::vector<Message::Address> adds;
    // adds.emplace_back("111.11.11.1", 1001);
    // adds.emplace_back("211.11.11.1", 3001);
    // adds.emplace_back("211.11.11.1", 2001);
    // rrc->SetDisResult(adds);
    // bool ret = rrc->Check();
    // std::string ss = rrc->Serialize();
    // std::cout << ss << std::endl;
}
